//获取浏览器的参数
function getQueryString(name) {
  return decodeURIComponent((new RegExp('[?|&]'+name+'='+'([^&;]+?)(&|#|;|$)').exec(location.href)||[,""])[1].replace(/\+/g,'%20'))||null;
}
var platform = getQueryString('type');
//console.log(platform);
var isH5 = getQueryString('h5');
//如果地址上有就从地址取并存储
if(platform){
    platform = platform.toLowerCase();
    localStorage.platform = platform; 
}else{
    //地址没传并且存储也没有就传h5
    if(!localStorage.platform){
        platform = "h5";
    }else{
        if(isH5){
            platform = localStorage.platform;
        }else{
            platform = "h5";
        }
    }
}

module.exports = {
    isH5:isH5,
    platform:platform,
    dev: 'http://192.168.3.164/', //测试服公共请求地址
    h5: 'http://tbb.gvgcn.com/',
    build: "http://47.93.220.49/", //生产环境公共请求地址
    iosUrl:"https://itunes.apple.com/us/app/%E6%A1%83%E5%AE%9D%E5%AE%9D/id1325433709?l=zh&ls=1&mt=8", //ios下载地址
    androidUrl:"http://f5.market.xiaomi.com/download/AppStore/0b839447d4bb54d2202a5c553cbdf57ece40ba33a/com.zhongyuhudong.socialgame.joying.apk" //安卓下载地址
}
